package com.drm.netschool.mapper;

import com.drm.netschool.entity.SumerShareDownrecord;
import com.drm.netschool.entity.SumerShareDownrecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SumerShareDownrecordMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_share_downrecord
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    int countByExample(SumerShareDownrecordExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_share_downrecord
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    int deleteByExample(SumerShareDownrecordExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_share_downrecord
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    @Delete({
        "delete from sumer_share_downrecord",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_share_downrecord
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    @Insert({
        "insert into sumer_share_downrecord (id, user_id, ",
        "resource_id, download_time, ",
        "reduce_integral)",
        "values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ",
        "#{resourceId,jdbcType=BIGINT}, #{downloadTime,jdbcType=TIMESTAMP}, ",
        "#{reduceIntegral,jdbcType=INTEGER})"
    })
    int insert(SumerShareDownrecord record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_share_downrecord
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    int insertSelective(SumerShareDownrecord record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_share_downrecord
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    List<SumerShareDownrecord> selectByExample(SumerShareDownrecordExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_share_downrecord
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    @Select({
        "select",
        "id, user_id, resource_id, download_time, reduce_integral",
        "from sumer_share_downrecord",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    SumerShareDownrecord selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_share_downrecord
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    int updateByExampleSelective(@Param("record") SumerShareDownrecord record, @Param("example") SumerShareDownrecordExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_share_downrecord
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    int updateByExample(@Param("record") SumerShareDownrecord record, @Param("example") SumerShareDownrecordExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_share_downrecord
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    int updateByPrimaryKeySelective(SumerShareDownrecord record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_share_downrecord
     *
     * @mbggenerated Tue Aug 11 10:37:27 CST 2015
     */
    @Update({
        "update sumer_share_downrecord",
        "set user_id = #{userId,jdbcType=BIGINT},",
          "resource_id = #{resourceId,jdbcType=BIGINT},",
          "download_time = #{downloadTime,jdbcType=TIMESTAMP},",
          "reduce_integral = #{reduceIntegral,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(SumerShareDownrecord record);
}